home *** CD-ROM | disk | FTP | other *** search
- Path: damon.irf.uni.dortmund.de!broth
- From: rothert@damon.irf.uni-dortmund.de (Bernd Rothert)
- Newsgroups: comp.lang.c++
- Subject: Re: BORLAND C++ 4.5 wont add .1 and .9
- Date: Wed, 24 Jan 96 16:40:20 GMT
- Organization: Institute of Robotics Research
- Message-ID: <4e5njv$e9v@damon.irf.uni-dortmund.de>
- References: <corekinDLG8t4.3C5@netcom.com>
- NNTP-Posting-Host: broth.irf
- X-Newsreader: News Xpress Version 1.0 Beta #4
-
- In article <corekinDLG8t4.3C5@netcom.com>,
- corekin@netcom.com (david corekin) wrote:
- >I had some problems with floating point numbers as well. In my
-
- Today I discovered that my BC++ 4.5 doesn't even add 1+1 correctly - try:
-
- #include <stdio.h>
- int one(void) { return 1; }
- int main(void)
- {
- int zero = 0;
- int two = (zero == 0) ? one()+1 : zero+1;
- printf("one() plus 1 is %d\n", two);
- return 0;
- }
-
- After compiling with "bcc -ml bug21.c" (BC++ version 4.5) the program outputs:
- one() plus 1 is 1
- which is not exactly what I whould expect...
-
- Bernd
-